/*-------------------------
Generating and adding a psudo random loot amount to the player
-------------------------*/
function GM:RandomLoot(ply, low, high, time )
	local PLAYER = ply:GetPlayerClass()
	local LOOT = math.random(low,high)
	local LOOTSPACE =  PLAYER.MaxLoot - ply:GetLoot()
	
	if(LOOT <= LOOTSPACE)then
		ply:AddLoot(LOOT)
		GAMEMODE:Push(ply,"Found $"..LOOT.." in loot", tonumber(time))
		
	elseif(LOOT > LOOTSPACE)then
		ply:SetLoot(PLAYER.MaxLoot)
		GAMEMODE:Push(ply,"Your backpack is full!",1)
		
	end
end

/*-------------------------
Loot Selling Stations
-------------------------*/
function GM:LootRefine(ply, markup)
	local ONPLAYER = ply:GetLoot()
		
	if(ONPLAYER > 0)then
		local SPEND = ply:GetMoney() 
		local NEWDOSH = (math.ceil(ONPLAYER / markup))
		GAMEMODE:Push(ply,"Sold Loot for $"..NEWDOSH,5)

		ply:AddMoney(NEWDOSH)
		ply:SetLoot(0)
	elseif(ONPLAYER <= 0 )then
		--nothing
	end
end